package com.bristua.common.biz;

import com.bristua.common.dao.TDictionaryMapper;
import com.bristua.common.model.TDictionary;
import com.bristua.common.model.condition.TDictionaryExample;
import com.bristua.common.utils.SequenceUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2019/4/29.
 */
@Service
public class QueryReturnScaleBiz {

    private final static String SCALE ="scale";

    @Resource
    private TDictionaryMapper tDictionaryMapper;

    public Map<String,String> queryeturnScale(){
        TDictionaryExample tDictionaryExample = new TDictionaryExample();
        tDictionaryExample.createCriteria().andDictionaryKeyEqualTo(SCALE);
        List<TDictionary> tDictionaries = tDictionaryMapper.selectByExample(tDictionaryExample);
        if(tDictionaries!=null && tDictionaries.size()>0){
            TDictionary tDictionary = tDictionaries.get(0);
            Map<String,String> data = new HashMap<>();
            data.put("scale",tDictionary.getDictionaryValue());
            return data;
        }
        return null;
    }
}
